/*---------------------------------------------------------------------------*/
/* Utils class : static class with some functions				     */
/*---------------------------------------------------------------------------*/
#ifndef UTILS_H
#define UTILS_H
/*---------------------------------------------------------------------------*/
#define foreach(type,it,myvector) for ( vector<type>::iterator it =(myvector).begin() ; (it) < (myvector).end(); (it)++  )

#ifndef DEBUG
	#define DEBUGMSG(x) 
#else
	#define DEBUGMSG(x) cout << x << endl
#endif

/*---------------------------------------------------------------------------*/
#include <string>
#include <vector>
/*---------------------------------------------------------------------------*/
using namespace std;
/*---------------------------------------------------------------------------*/
typedef unsigned int uint;
class FileNode;
/*---------------------------------------------------------------------------*/
class Utils
{
	public:
	
	static string 	formatSize( double ss, char baselevel = 0 );
	static string 	formatSize( int ss );
	static string 	toString( uint val );
	static string 	toString( int val );
	
	static string 	getExt(string name);
	static char		getLastChar(string name);
	
	static string 	escapeChars(string str);
	static string   groupStringFiles( vector<FileNode*> v, char ch = ';', bool esc = false );
	
	static bool 	isDirectory(const string dname);
	
};
/*---------------------------------------------------------------------------*/
#endif
